<?

class hotel_references {





// Function // Search for a booking using the booking id
function search_hotel_reference($params){

	$params = in($params);

	$sql = "SELECT * 
	FROM hotel_references 
	WHERE reference_id = '".$params['reference_id']."'
	LIMIT 1 ";
	
	return apply_query($sql);

}




// FUNCTION // Insert request reference
function insert_reference($params){

if(!empty($params)){

	$params = in($params);
	
	$sql = "INSERT INTO hotel_references
	SET reference_date = '".mktime()."',
	hotel_name = '".$params['hotel_name']."',
	hotel_id_supplier = '".$params['hotel_id_supplier']."',
	tree_id = '".$params['tree_id']."',
	check_in_date = '".$params['check_in_date']."',
	nights = '".$params['nights']."',
	room_count = '".$params['rooms_count']."',
	room_breakdown = '".$params['room_breakdown']."' ";

	$result = mysql_query($sql) or die (mysql_error());
	
	// Return the reference ID
	return mysql_insert_id();
}

}








}
?>